#define _CRT_SECURE_NO_WARNINGS 1
#include<bits/stdc++.h>
using namespace std;

int main()
{
	int n;
	cin >> n;
	int empty = 0;
	int total = 0;
	empty = n;
	total = n;
	while (empty>=3)
	{
		total += empty / 3;
		empty = empty / 3 + empty % 3;
	}
	cout << total << endl;
	return 0;
}